<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    <col width="50%">
    <col width="50%">
    <?php if(isset ($aryCtv[0])){?>
    <?php foreach ($aryCtv as $key => $value) {?>
        <tr class="<?php echo ($key % 2 == 0) ? 'alt' : '' ?>">
            <td>
                <ul class="ul-list-order">
                    <li class="list-order-header">Họ tên</li>
                    <li class="list-order-detail"><?php echo $value['customer_full_name'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Ngày sinh</li>
                    <li class="list-order-detail"><?php echo date("d/m/Y", strtotime($value['customer_date_birthday']));?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Địa chỉ</li>
                    <li class="list-order-detail"><?php echo $value['customer_address'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Điện thoại di động</li>
                    <li class="list-order-detail"><?php echo $value['customer_mobile_phone'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Điện thoại bàn</li>
                    <li class="list-order-detail"><?php echo $value['customer_home_phone'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Email</li>
                    <li class="list-order-detail"><?php echo $value['customer_email'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Yahoo</li>
                    <li class="list-order-detail"><a href="ymsgr:sendIM?<?php echo $value['customer_yahoo']; ?>"><img border="0" align="absmiddle" src="http://opi.yahoo.com/online?u=<?php echo $value['customer_yahoo']; ?>&amp;m=g&amp;t=1"></a></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Skype</li>
                    <li class="list-order-detail"><a href="skype:<?php echo $value['customer_skype']; ?>?chat"><img src="http://mystatus.skype.com/smallicon/<?php echo $value['customer_skype']; ?>"></a></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Ngày tham gia</li>
                    <li class="list-order-detail"><?php echo date("d/m/Y", strtotime($value['customer_join_date']));?></li>
                </ul>
            </td>
            <td>
                <ul class="ul-list-order">
                    <li class="list-order-product-header w200p">
                        Tổng sản phẩm
                        <div class="list_item_ctv">
                            Trong tháng <?php echo $month;?>-<?php echo $year;?>
                            <div>
                                <?php if(is_array($aryTotalCustomerProduct)){?>
                                <?php foreach ($aryTotalCustomerProduct as $key2 => $product) {?>
                                    <?php if($key2 == $value['customer_id']) {?>
                                        <?php echo $product['customer_total_product'];?>
                                    <?php } ?>
                                <?php } ?>
                            <?php }else{?>
                              0
                            <?php } ?>
                            </div>
                        <div style="padding-left: 10px;">
                           Đã chốt:
                             <?php if(is_array($aryTotalProduct)){?>
                                <?php foreach ($aryTotalProduct as $key2 => $product) {?>
                                    <?php if($key2 == $value['customer_id']) {?>
                                        <?php echo $product['customer_total_product'];?>
                                    <?php } ?>
                                <?php } ?>
                            <?php }else{?>
                              0
                            <?php } ?>
                        </div>
                            <div style="padding-left: 10px;">
                                Chưa chốt:
                                <?php if(is_array($aryCurrentProduct)){?>
                                <?php foreach ($aryCurrentProduct as $key2 => $product) {?>
                                    <?php if($key2 == $value['customer_id']) {?>
                                <span style="color: red;"><?php echo $product['customer_total_product'];?></span>
                                    <?php } ?>
                                <?php } ?>
                            <?php }else{?>
                              0
                            <?php } ?>
                            </div>
                        </div>
                        <div style="font-weight: bold;">
                            Tổng lợi nhuận
                        </div>
                        <div class="list_item_ctv">
                            Trong tháng <?php echo $month;?>-<?php echo $year;?>
                            <div>
                            <?php if(is_array($aryTotalCustomerProduct)){?>
                            <?php foreach ($aryTotalCustomerProduct as $key2 => $product) {?>
                                <?php if($key2 == $value['customer_id']) {?>
                                    <?php echo number_format($product['customer_product_ctv_profit'], 0, ',', '.'); ?>&nbsp;VNĐ
                                <?php } ?>
                            <?php } ?>
                            <?php }else{ ?>
                                    0
                            <?php }?>
                            </div>

                            <div style="padding-left: 5px;padding-top: 5px;">
                                Cộng tác viên
                                <div style="padding-left: 5px;">
                                    -Đã chốt:
                            <?php if(is_array($aryTotalProduct)){?>
                            <?php foreach ($aryTotalProduct as $key2 => $product) {?>
                                <?php if($key2 == $value['customer_id']) {?>
                                    <?php echo number_format($product['customer_product_ctv_profit'], 0, ',', '.'); ?>&nbsp;VNĐ
                                <?php } ?>
                            <?php } ?>
                            <?php }else{ ?>
                                    0
                            <?php }?>
                                </div>

                                <div style="padding-left: 5px;">
                                -Chưa chốt:
                                    <?php if(is_array($aryCurrentProduct)){?>
                                        <?php foreach ($aryCurrentProduct as $key2 => $product) {?>
                                            <?php if($key2 == $value['customer_id']) {?>
                                                <span style="color: red;"><?php echo number_format($product['customer_product_ctv_profit'], 0, ',', '.'); ?>&nbsp;VNĐ</span>
                                            <?php } ?>
                                        <?php } ?>
                                    <?php }else{ ?>
                                    0
                                    <?php }?>
                            </div>
                            </div>
                            <div style="padding-left: 5px;padding-top: 5px;">
                                Kinh doanh
                                <div style="padding-left: 5px;">
                                   -Đã chốt:<?php if(is_array($aryTotalProduct)){?>
                            <?php foreach ($aryTotalProduct as $key2 => $product) {?>
                                <?php if($key2 == $value['customer_id']) {?>
                                    <?php echo number_format($product['customer_product_kd_profit'], 0, ',', '.'); ?>&nbsp;VNĐ
                                <?php } ?>
                            <?php } ?>
                            <?php }else{ ?>
                                    0
                            <?php }?>
                                </div>
                                <div style="padding-left: 5px;">
                                   -Chưa chốt:
                                   <?php if(is_array($aryCurrentProduct)){?>
                                        <?php foreach ($aryCurrentProduct as $key2 => $product) {?>
                                            <?php if($key2 == $value['customer_id']) {?>
                                                <span style="color: red;"><?php echo number_format($product['customer_product_kd_profit'], 0, ',', '.'); ?>&nbsp;VNĐ</span>
                                            <?php } ?>
                                        <?php } ?>
                                    <?php }else{ ?>
                                    0
                                    <?php }?>
                                </div>
                            </div>

                        </div>

                    </li>
                    <li class="list-order-product-header">
                        Người phụ trách
                        <div class="list_item_ctv">
                            <?php echo $aryLogin['member_login_name'];?>
                        </div>
                    </li>
                </ul>

            </td>
        </tr>
        <tr class="<?php echo ($key % 2 == 0) ? 'alt' : '' ?>">
            <td colspan="2" align="right">
                <span><a class="cpointer" onclick="AdminController.viewDetailSearchMyCtv(<?php echo $value['customer_id'];?>)">Xem chi tiết</a></span>
            </td>
        </tr>
    <?php } ?>
    <?php }else{ ?>
        <div style="text-align: center;font-weight: bold;color: #F58516;">Không có dữ liệu tháng <?php echo $month;?>/<?php echo $year;?></div>
    <?php }?>
    

</table>
<div class="clear"></div>
<div align="right"><?php echo $strPaging; ?></div>
